package ProcessControl;

import java.util.Scanner;

public class Demo01 {
    public static void main(String[] args) {
        //创建一个接收器接收键盘输入
//        Scanner scanner = new Scanner(System.in);
//        System.out.println("请输入内容: ");
//        str=scanner .next();
//        System.out.println("输入的内容为: "+str);
//        scanner.close();
        Scanner scanner = new Scanner(System.in);
        System.out.println("使用next接收: ");
        //判断用户是否输入字符串
        if (scanner.hasNext()){
            String s = scanner.next();
            System.out.println("输入的内容为: "+s);
        }
    scanner.close();

    }
}
